const express = require("express");
const app = express();

app.get("/request", (req, res) => {
  console.log(req.method);
  console.log(req.url);
  console.log(req.httpVersion);
  console.log(req.headers);

  // express封装操作
  console.log(req.path);
  console.log(req.query);
  console.log(req.ip);
  console.log(req.get("host"));
  res.end("Hello express");
});

app.listen(3000, () => {
  console.log("服务已经启动，端口 3000 正在监听中....");
});
